package cn.cdeden.knowledge.mapper;

import cn.cdeden.knowledge.domain.PersonalFilesTree;
import cn.cdeden.knowledge.domain.dto.FilesTree;
import cn.cdeden.knowledge.domain.dto.PersonalFilesTreeParam;
import cn.cdeden.knowledge.domain.dto.SearchFilesInfoDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PersonalFilesTreeMapper extends BaseMapper<PersonalFilesTree> {

    int upDateFolderSizeSum(List<String> ids , long size);

    int upDateFolderSizeLess(List<String> ids , long size);

    List<PersonalFilesTree> selectTree(@Param("query") PersonalFilesTreeParam query);

    IPage<PersonalFilesTree> selectTree(@Param("query") PersonalFilesTreeParam query , IPage<PersonalFilesTree> page);


    int upDateFolderSizeUpDate(@Param("ids") List<String> ids , @Param("originalSize") Long originalSize, @Param("newSize") Long newSize);


    IPage<FilesTree> selectPersonalTreePage(@Param("query") SearchFilesInfoDto query, IPage page);


    /**
     * @Description
     * @param ids
     * @param deleteType 1 没有删除的  2.删除的 3，全部查询
     * @return java.util.List<com.cdyd.ecm.modules.personDoc.domain.PersonalFilesTree>
     **/
    List<PersonalFilesTree> selectJuniorAll(@Param("ids") List<String> ids, @Param("deleteType") String deleteType);


    List<PersonalFilesTree> selectAllSubordinate(@Param("ids")String ids ,@Param("userId")String userId, @Param("b") Boolean b);



    List<FilesTree> selectPersonalSuperiorFolder(@Param("ids") List<String> ids,
                                                 @Param("userId") String userId,
                                                 @Param("sort") List<String> sort) ;


    //    查询树id在在第几页数据
    int selectByIdTreePageInfo(@Param("userId") String userId ,
                               @Param("treeId") String treeId,
                               @Param("parentId") String parentId,
                               @Param("size") Integer size,
                               @Param("sort") List<String> sort);


    List<PersonalFilesTree> getAllChildById(Long id);




}
